﻿function now(){date=new Date();var t=date.getFullYear().toString();t+=(date.getMonth()+1).toString();t+=(date.getDate()).toString();t+=(date.getHours()).toString();t+=(date.getMinutes()).toString();t+=(date.getSeconds()).toString();t+=(date.getMilliseconds()).toString();return t;};
function showKeyWords(title, url)
{

	//var url="KeyWord-" + id + ".html?t="+now();
	layer.open({
      type: 2,
      title: title,
      maxmin: false,
      shadeClose: true, //点击遮罩关闭层
      area : ["96%" , "80%"],	
	  // content: [url,'no'], 
	  content: url,
	  success: function(layero, index){},
	  cancel: function(index, layero){layer.close(index);},
	  end : function(index){layer.close(index);}
    });	
	//alert(id);	
};
 
function show_eTreeView(obj) {

        var evt;
        var src;

        if (window.event) {
            evt = window.event;
            src = evt.srcElement;
        }
        else {
            var o = arguments.callee;
            var e;
            while (o != null) {
                e = o.arguments[0];
                if (e && (e.constructor == Event || e.constructor == MouseEvent)) { evt = e; src = evt.target; break; }
                o = o.caller;
            }
        }
        var li = $(obj).parent();
		if(src.tagName=="SPAN")li=li.parent();
		
        if (src.tagName != "LI" && src.tagName != "A" && src.tagName!="SPAN") { return false; }
        if (evt.stopPropagation) { evt.stopPropagation(); } else { evt.cancelBubble = true; }
        if (evt.preventDefault) { evt.preventDefault(); } else { evt.cancelBubble = true; }
        var ul = li.children("ul");
        if (ul.length == 0) { return false; }

        if (li.attr("class") == "close") {
            li.attr("class", "open");
            //ul.show();
            ul.slideDown();
        }
        else {
            li.attr("class", "close");
            //ul.hide();
            ul.slideUp();

        }
        //if(li.attr("class")!="close"&&li.attr("class")!="open"){return false;}
        return false;
};
function switchSearch()
{
	var sbox = $("#eSearchBox");
	if (sbox.is(":hidden"))
	{
		//sbox.show();
		sbox.slideDown();
    }
	else
	{
		//sbox.hide();
        sbox.slideUp();
    }
};﻿
function goSearch(frm)
{
	//var url=$(frm).attr("action") + "?key=" + frm.key.value;
	var url=$(frm).attr("action");
	url+=url.indexOf("?")>-1? "&" : "?";
	url+="key=" + frm.key.value;
	if(frm.key.value.length>0)
	{
		$.ajax({
			type: 'post',
			async: false,
			url:  url,	
			data:{key:frm.key.value},
			dataType: "html",
			success: function(data)
			{
			}
		});	
	}
	document.location.assign(url);
	return false;
};
$(document).ready(function () {
        $("#treeparent").height($(".treeaside").height() + "px");
        $("#sidebody").height($("#sidebody").height() + "px");
        $("#sideparent").height(($(".ui-aside").height() - 59 - ($(".toolmenu") ? $(".toolmenu").height() : 0)) + "px");

        var _count = 0;
	 //顶部菜单和目录树
	  var asideLift = $(".ui-aside").asideUi({
            hasmask: true,
            size: "6rem",
            position: "left",
            sidertime: 300
        });
     //.unbind("touchstart")
	  $(".eHeader .menu").on("click", function () {
	     // _count++;
	      //$(".eHeader .center").html(_count);
            asideLift.toggle();
        });

	  var scrollTop = 0;
	$("#sideparent").bind("touchstart", function (events) {

		//document.title="on";
		
	});
	$("#sideparent").bind("touchend", function (events) {
		//$(document.body).unbind("touchmove");
		//document.title="off";

	});


	 
});